﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using MINERP.COM;

namespace MINERP.BLL.DisjoinProForOutShop
{
    public class OrderView
    {
        /// <summary>
        /// 订单
        /// </summary>
        public Tb_OrderBag_Info Orderbag { get; set; }
        /// <summary>
        /// 产品
        /// </summary>
        public OrderInfo_Info Orderinfo { get; set; }
        /// <summary>
        /// 流程
        /// </summary>
        public WorkOrderFlowList_Info workOrderFlow { get; set; }

        /// <summary>
        /// 流程名称s
        /// </summary>
        public Tb_Tech_Info Tech{get;set;}

        public int OrderId
        {
            get {
                return Orderbag.OrderBagId;
            }
        }
        public string OrderBagBarCode
        {
            get
            {
                return Orderbag.BagCode;
            }
        }

        public string OrderName
        {
            get
            {
                return Orderbag.BagName;
            }
        }
        public DateTime OrderTime
        {
            get
            {
                return Orderbag.OrderTime;
            }

        }
        public DateTime FetchTime
        {
            get
            {
                return Orderbag.FetchTime;
            }
        }

        public string OrderRemark
        {
            get
            {
                return Orderbag.Remark;
            }
        }

        public int ProductId
        {
            get
            {
                return Orderinfo.OrderProductId;
            }
        }
        public string ProductCode
        {
            get
            {
                return Orderinfo.OrderProductCode;
            }
        }
        public string ShopName
        {
            get
            {
                return Orderbag.ShopName;
            }
        }
        public string   ProductName
        {
            get
            {
                return Orderinfo.OrderProductName;
            }
        }

        public string CtmName
        {
            get
            {
                return Orderinfo.CtmName;
            }
        }
        public DateTime CompleteTime
        {
            get
            {
                return Orderinfo.CompleteTime;
            }
        }

        public string ProductStatus
        {
            get
            {
                return "";//判断
            }

        }
        public string Size
        {
            get
            {
                return Orderinfo.Width + "×" + Orderinfo.Height;
            }

        }
        public string ProductRemark
        {
            get
            {
                return Orderinfo.Remark;
            }
        }

        //public string ProductRemark
        //{
        //    get
        //    {
        //        return Orderinfo.Remark;
        //    }
        //}

        public int  ProductNum
        {
            get
            {
                return Orderinfo.ProductNum;
            }
        }
        public int PageNum
        {
            get
            {
                return Orderinfo.PageNum;
            }
        }
        public string TechName
        {
            get
            {
                return Tech.TechName;
            }
        }

        public string Remark
        {
            get
            {
                return Orderbag.Remark + Orderinfo.Remark;
            }
        }
        public bool IsInGrid//只做显示用
        {
            get;
            set;
        }
        public string oiStatus
        {
            get
            {
                switch (Orderinfo.Status)
                {
                    case (int)OrderInfoStatus.Doing:
                        return "正常生产";
                        break;
                    case (int)OrderInfoStatus.Error:
                        return "异常";
                        break;
                    case (int)OrderInfoStatus.Stop:
                        return "停止生产";
                        break;
                    case (int)OrderInfoStatus.Completed:
                        return "完成";
                        break;
                    case (int)OrderInfoStatus.NoCheckCount:
                    case (int)OrderInfoStatus.WaitPay:
                        return "余额不足,等待付款";
                        break;
                    case (int)OrderInfoStatus.WaitPhotoMove:
                    case (int)OrderInfoStatus.WaitPayAndWaitMovePhoto:
                        return "等待照片移动";
                        break;
                    case (int)OrderInfoStatus.AutoStartOrder:
                        return "自动开单";
                        break;
                    case (int)OrderInfoStatus.AutoOrderWait:
                        return  "远程开单等待审核"; break;
                    default:
                        return "异常";
                        break;

                }
            }
        }

    }
}
